<template>
	<view>
		<u-modal :show="true" title="温馨提示" content="此账号在另一台设备上登录,请确认是否为本人,否则请及时修改密码!即将跳转到登录页面!" width="500rpx"
			@confirm="out" confirmColor="#6869a8" :confirmText="btn">
		</u-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				time: 10,
				id: null,
			}
		},
		mounted() {
			this.time = 10
			let self = this
			this.id = setInterval(() => {
				self.time = self.time - 1;
				if (self.time == 0) {
					self.out()
				}
			}, 1000)
		},
		computed: {
			btn() {
				return "确认(" + this.time + ")"
			}
		},
		methods: {
			out() {
				clearInterval(this.id)
				uni.reLaunch({
					url: "../login/login"
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: rgba(255, 255, 255, 0.2);
	}
</style>
